define(function(require, exports){
	var $		= require("jquery");
	var pubjs	= require('pubjs');
	var popwin	= require('@base/dialog').base;
	var util	= require('util');

	var Base = popwin.extend({
		init:function(config){
			config = pubjs.conf(config, {
				//'title': LANG('选择产品账号进行操作'),
				'class': 'P-info',
				"showHead": false,
				"buttons":["ok"],
				"showClose": false
			});

			this.Super('init', arguments);
		},
		afterBuild:function(){
			this.Super('afterBuild',arguments);
			var el = this.getDOM('body');
			var c = this.getConfig();
			el.append($([
				'<div>',
					'<label>'+ LANG('请选择相应的账号:') +'</label>',
					'<div pub-name="account" pub-mod="@base/common/drop.drop">',
				'</div>'
			].join('')));


			var config = {
				'account': {
					'options': c.list || []
					,'key': '_id'
					,'name': 'Name'
					,"def": LANG("选择产品账号")
					,'panel_config': {
						'height': 200
					}
				}
			};

			this.buildFromTemplate(config);
		},
		onOk: function() {
			var c = this.getConfig();
			var value = this.$.account.getValue(true).id;
			if(value) {
				pubjs.mc.send('login/verifyAccount', util.extend({}, c.param,{accountId: +value}), c.cb);
				this.hide();
			}
			else {
				pubjs.alert(LANG('请先选择对应的账号.'));
				return false;
			}
		}
	});

	exports.base = Base;

});